*** Settings ***
Library           SeleniumLibrary
Library           String
Library           AutoItLibrary
Resource          ../常用变量.txt
Resource          ../基本配置.txt
Resource          ../浏览器变量.txt
Resource          ../常用变量.txt
Resource          供应商信息.txt

*** Test Cases ***
供应商信息添加-优-车辆维修
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-车辆维修
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-车辆保险
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-车辆保险
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-食堂劳务
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-食堂劳务
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-食品配送
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-食品配送
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-物业管理
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-物业管理
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-基建工程
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-基建工程
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-科技服务
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-科技服务
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-小型维修工程
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-小型维修工程
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息添加-优-会议定点
    [Setup]    login
    #打开添加供应商页面
    goto    ${purchase_provider_add_url}
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    Comment    电子邮件    856325478@qq.com
    Comment    ${provider_email}    随机邮箱
    Comment    ${email_tex}    evaluate    "".join(random.sample("0123456789",8))    random,string
    Comment    ${email_temp}    @qq.com
    Comment    ${email}    Catenate    SEPARATOR=    ${email_tex}    @qq.com
    Comment    log    ${email}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    排序    1
    #默认可用状态为可用
    信用等级-优
    类型-会议定点
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close

供应商信息-修改
    [Setup]    login
    add_provider_purchase
    Comment    close browser
    goto    ${purchase_provider_list}
    capture page screenshot
    #点击修改按钮
    供应商-修改操作
    sleep    3
    ${provider_list_title}    get window handles
    log    ${provider_list_title}
    #进入修改页面
    Comment    select window    new
    #输入供应商的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal_representative}    Generate Random String    6
    法人代表    ${provider_Legal_representative}
    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    开户行    ${provider_bank_id}
    ${provider_bank_account}    evaluate    "".join(random.sample("0123456789",10))    random,string
    开户账号    ${provider_bank_account}
    #默认标记该供应商为合格
    标记不合格
    排序    1
    #默认可用状态为可用
    可用状态-停用
    信用等级-优
    类型-车辆维修
    ${provider_Credit_rating_description}    Generate Random String    20
    信用等级说明    ${provider_Credit_rating_description}
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    sleep    5
    供应商-保存
    sleep    5
    断言供应商信息添加成功    ${provider_name}
    [Teardown]    close
